<?php

/**
 * Form used to publish a new message.
 * @author Christophe Sourisse
 */
class Application_Form_Publish extends Zend_Form
{

    public function __construct($label_textarea, $label_submit, $options = null) {
        parent::__construct($options);
        
        // Set the method for the displayed form to POST
        $this->setMethod('post');
        
        // Set the form's ID attribute
        $this->setName('formPublish');
        
        // Add the textarea to type the new post
        $this->addElement('textarea', 'message', array(
            'label' => $label_textarea,
            'required' => true,
            'rows' => 3,
            'cols' => 30,
            'value' => 'Write something!'
        ));
        
        // Add the Submit button
        $this->addElement('submit', 'submitPost', array(
            'ignore' => true,
            'label' => $label_submit
        ));
        
    }


}

